@echo off
setlocal

set "prefix=[scripts/game-gui.bat]$"

if not exist "%1\books\qpc" (
	echo %prefix% ERROR, %1\books\qpc NOT exist!
	exit /b -1
)

if exist "%1\examples\%2" (
    rd /s /q "%1\examples\%2"
)

mkdir "%1\examples\%2"

set "qpc=%1\books\qpc"
set "game-gui=%1\examples\%2"

xcopy "%qpc%\include" "%game-gui%\include" /E /I /H /Y
xcopy "%qpc%\qep\source" "%game-gui%\qep" /E /I /H /Y
xcopy "%qpc%\qf\source" "%game-gui%\qf" /E /I /H /Y
xcopy "%qpc%\ports\win32\mingw" "%game-gui%\ports\win32\mingw" /E /I /H /Y
xcopy "%qpc%\examples\win32\mingw\game-gui" "%game-gui%\game-gui" /E /I /H /Y

copy "%1\scripts\%2.Makefile" "%game-gui%\Makefile"

endlocal

exit /b 0
